<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <script type="text/javascript" src="./lib/vue-2.4.0.js"></script>
  </head>
  <body>
    <div id="app">
      <input type="button" value="toggle" @click="flag=!flag" />
      <!-- 需求：点击按钮，让 h3 显示，再点击，让 h3 隐藏 -->
      <h3 v-if="flag" v-text="msg"></h3>
    </div>

    <script type="text/javascript">
      // 创建 Vue实例，得到 ViewModel
      var vm = new Vue({
        el: "#app",
        data: {
          msg: "这是一个H3",
          flag: false
        },
        methods: {}
      });
    </script>
  </body>
</html>
